## ----setup, include = FALSE----------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(quantmod)
library(CandleStickPattern)
#getSymbols("MSFT")

## ---- eval = FALSE-------------------------------------------------------
#  #install.packages("devtools")
#  library(devtools)

## ---- eval = FALSE-------------------------------------------------------
#  #install_github("kochiuyu/CandleStickPattern")
#  library(CandleStickPattern)

## ------------------------------------------------------------------------
price <- MSFT['2011-07-08/2011-07-19']
candleChart(price,theme='white')

## ------------------------------------------------------------------------
doji(price)

## ------------------------------------------------------------------------
price <- MSFT['2014-10-28/2014-11-03']
candleChart(price,theme='white')

## ------------------------------------------------------------------------
dragonfly.doji(price)

## ------------------------------------------------------------------------
price <-MSFT['2015-04-28/2015-05-01']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
gravestone.doji(price)

## ------------------------------------------------------------------------
price <- MSFT['2011-10-18/2011-10-25']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
hammer(price)

## ------------------------------------------------------------------------
price <- MSFT['2011-11-20/2011-11-30']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
inverted.hammer(price)

## ------------------------------------------------------------------------
price <- MSFT['2011-11-02/2011-11-08']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
bullish.engulf(price)

## ------------------------------------------------------------------------
price <-MSFT['2011-12-15/2011-12-20']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
bearish.engulf(price)

## ------------------------------------------------------------------------
price <- MSFT['2011-12-27/2011-12-30']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
bullish.harami(price)

## ------------------------------------------------------------------------
price <- MSFT['2011-11-02/2011-11-07']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
bearish.harami(price)

## ------------------------------------------------------------------------
price <-MSFT['2011-07-26/2011-07-30']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
piercing.line(price)

## ------------------------------------------------------------------------
price <- MSFT['2011-09-16/2011-09-21']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
dark.cloud.cover(price)

## ------------------------------------------------------------------------
price <-MSFT['2011-11-08/2011-11-14']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
kick.up(price)

## ------------------------------------------------------------------------
price <- MSFT['2010-08-16/2010-08-19']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
kick.down(price)

## ------------------------------------------------------------------------
price <-MSFT['2007-05-20/2007-06-01']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
TWS <- three.white.soldiers(MSFT)
TWS['2007-05-20/2007-06-01']

## ------------------------------------------------------------------------
price <-MSFT['2010-01-15/2010-02-09']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
TBC <- three.black.crows(MSFT)
TBC['2007-05-20/2007-06-01']

## ------------------------------------------------------------------------
price <- MSFT['2013-06-09/2013-06-18']
candleChart(MSFT['2013-06-09/2013-06-18'], theme='white')

## ------------------------------------------------------------------------
MS <- morning.star(MSFT)
MS['2013-06-09/2013-06-18']

## ------------------------------------------------------------------------
price <-MSFT['2011-11-01/2011-11-11']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
ES <- evening.star(MSFT)
ES['2011-11-01/2011-11-11']

## ------------------------------------------------------------------------
price <-MSFT['2012-01-10/2012-01-22']
candleChart(price, theme='white')

## ------------------------------------------------------------------------
RT <- rising.three(MSFT)
RT['2012-01-10/2012-01-22']

